from django.conf.urls import url
from houses.views.areas import AreaListView
from houses.views.house_images import HouseImageView
from houses.views.houses import HouseListView, HouseRecommendView, \
    HouseView, HouseDetailView

urlpatterns = [
    # 获取城区列表
    url(r'^api/v1.0/areas/$', AreaListView.as_view()),
    # 房源相关操作{'GET':'搜索房源''POST':'添加新房源'}
    url(r'^api/v1.0/houses/$', HouseView.as_view()),
    # 添加房源图片
    url(r'^api/v1.0/houses/(?P<pk>\d+)/images/$', HouseImageView.as_view()),
    # 展示用户房源
    url(r'^api/v1.0/user/houses/$', HouseListView.as_view()),
    # 首页房源推荐
    url(r'^api/v1.0/houses/index/$', HouseRecommendView.as_view()),
    # 房源详情
    url(r'^api/v1.0/houses/(?P<pk>\d+)/$', HouseDetailView.as_view()),
]
